package main // tylnmall project main.go

import (
	//db "tylnmall/database"
	"github.com/jinzhu/gorm"
	_ "github.com/go-sql-driver/mysql"
	"fmt"
	"net/http"
)

var db *gorm.DB
var err error
func main() {
	//defer db.SqlDB.Close()

	//fmt.Println(service.GetCurrentPath())
	db, err = gorm.Open("mysql", "root:123456@tcp(127.0.0.1:3306)/test2?charset=utf8&parseTime=True&loc=Local")
	if err != nil {
		fmt.Println(err)
	}
	defer db.Close()
	router := initRouter()
	router.StaticFS("/file", http.Dir("/home/gopath/src/tylnmall/file"))
	router.Run(":8888")
}
